<div class="modal" ng-controller="FlowableFormPropertiesPopupCtrl">
  <div class="modal-dialog modal-wide">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">&times;</button>
        <h2>{{ 'PROPERTY.PROPERTY.EDIT.TITLE' | translate }} "{{ property.title | translate }}"</h2>
      </div>
      <div class="modal-body">
        <!-- <div class="row row-no-gutter">
          <div class="col-xs-6">
            <div ng-if="translationsRetrieved" class="kis-listener-grid" ui-grid="gridOptions" ui-grid-selection></div>
            <div class="pull-right">
              <div class="btn-group">
                <a
                  class="btn btn-icon btn-lg"
                  rel="tooltip"
                  data-title="{{ 'ACTION.MOVE.UP' | translate }}"
                  data-placement="bottom"
                  data-original-title=""
                  title=""
                  ng-click="movePropertyUp()"
                  ><i class="glyphicon glyphicon-arrow-up"></i
                ></a>
                <a
                  class="btn btn-icon btn-lg"
                  rel="tooltip"
                  data-title="{{ 'ACTION.MOVE.DOWN' | translate }}"
                  data-placement="bottom"
                  data-original-title=""
                  title=""
                  ng-click="movePropertyDown()"
                  ><i class="glyphicon glyphicon-arrow-down"></i
                ></a>
              </div>
              <div class="btn-group">
                <a
                  class="btn btn-icon btn-lg"
                  rel="tooltip"
                  data-title="{{ 'ACTION.ADD' | translate }}"
                  data-placement="bottom"
                  data-original-title=""
                  title=""
                  ng-click="addNewProperty()"
                  ><i class="glyphicon glyphicon-plus"></i
                ></a>
                <a
                  class="btn btn-icon btn-lg"
                  rel="tooltip"
                  data-title="{{ 'ACTION.REMOVE' | translate }}"
                  data-placement="bottom"
                  data-original-title=""
                  title=""
                  ng-click="removeProperty()"
                  ><i class="glyphicon glyphicon-minus"></i
                ></a>
              </div>
            </div>
          </div>

          <div class="col-xs-6">
            <div ng-show="selectedProperty">
              <div class="form-group">
                <label for="idField">{{ 'PROPERTY.FORMPROPERTIES.ID' | translate }}</label>
                <input
                  id="idField"
                  class="form-control"
                  type="text"
                  ng-model="selectedProperty.id"
                  placeholder="{{ 'PROPERTY.FORMPROPERTIES.ID.PLACEHOLDER' | translate }}"
                />
              </div>
              <div class="form-group">
                <label for="nameField">{{ 'PROPERTY.FORMPROPERTIES.NAME' | translate }}</label>
                <input
                  id="nameField"
                  class="form-control"
                  type="text"
                  ng-model="selectedProperty.name"
                  placeholder="{{ 'PROPERTY.FORMPROPERTIES.NAME.PLACEHOLDER' | translate }}"
                />
              </div>
              <div class="form-group">
                <label for="typeField">{{ 'PROPERTY.FORMPROPERTIES.TYPE' | translate }}</label>
                <select
                  id="typeField"
                  class="form-control"
                  ng-model="selectedProperty.type"
                  ng-change="propertyTypeChanged()"
                >
                  <option>string</option>
                  <option>long</option>
                  <option>boolean</option>
                  <option>date</option>
                  <option>enum</option>
                </select>
              </div>
              <div class="form-group" ng-show="selectedProperty.datePattern">
                <label for="datePatternField">{{ 'PROPERTY.FORMPROPERTIES.DATEPATTERN' | translate }}</label>
                <input
                  id="datePatternField"
                  class="form-control"
                  type="text"
                  ng-model="selectedProperty.datePattern"
                  placeholder="{{ 'PROPERTY.FORMPROPERTIES.DATEPATTERN.PLACEHOLDER' | translate }}"
                />
              </div>
              <div ng-show="selectedProperty.type == 'enum'" style="padding-bottom:10px">
                <div class="row row-no-gutter">
                  <div class="col-xs-6">
                    <div
                      ng-if="translationsRetrieved"
                      class="kis-listener-grid"
                      ui-grid="enumGridOptions"
                      ui-grid-selection
                      ui-grid-auto-resize
                    ></div>
                    <div class="pull-right">
                      <div class="btn-group">
                        <a
                          class="btn btn-icon btn-lg"
                          rel="tooltip"
                          data-title="{{ ACTION.MOVE.UP | translate }}"
                          data-placement="bottom"
                          data-original-title=""
                          title=""
                          ng-click="moveEnumValueUp()"
                          ><i class="glyphicon glyphicon-arrow-up"></i
                        ></a>
                        <a
                          class="btn btn-icon btn-lg"
                          rel="tooltip"
                          data-title="{{ ACTION.MOVE.DOWN | translate }}"
                          data-placement="bottom"
                          data-original-title=""
                          title=""
                          ng-click="moveEnumValueDown()"
                          ><i class="glyphicon glyphicon-arrow-down"></i
                        ></a>
                      </div>
                      <div class="btn-group">
                        <a
                          class="btn btn-icon btn-lg"
                          rel="tooltip"
                          data-title="{{ ACTION.ADD | translate }}"
                          data-placement="bottom"
                          data-original-title=""
                          title=""
                          ng-click="addNewEnumValue()"
                          ><i class="glyphicon glyphicon-plus"></i
                        ></a>
                        <a
                          class="btn btn-icon btn-lg"
                          rel="tooltip"
                          data-title="{{ ACTION.REMOVE | translate }}"
                          data-placement="bottom"
                          data-original-title=""
                          title=""
                          ng-click="removeEnumValue()"
                          ><i class="glyphicon glyphicon-minus"></i
                        ></a>
                      </div>
                    </div>
                  </div>

                  <div class="col-xs-6">
                    <div ng-show="selectedEnumValue">
                      <div class="form-group">
                        <label for="classField">{{ 'PROPERTY.FORMPROPERTIES.VALUES.ID' | translate }}</label>
                        <input
                          type="text"
                          id="classField"
                          class="form-control"
                          ng-model="selectedEnumValue.id"
                          placeholder="{{ 'PROPERTY.FORMPROPERTIES.VALUES.ID.PLACEHOLDER' | translate }}"
                        />
                      </div>
                      <div class="form-group">
                        <label for="classField">{{ 'PROPERTY.FORMPROPERTIES.VALUES.NAME' | translate }}</label>
                        <input
                          type="text"
                          id="classField"
                          class="form-control"
                          ng-model="selectedEnumValue.name"
                          placeholder="{{ 'PROPERTY.FORMPROPERTIES.VALUES.NAME.PLACEHOLDER' | translate }}"
                        />
                      </div>
                    </div>
                    <div ng-show="!selectedEnumValue" class="muted no-property-selected" translate>
                      PROPERTY.FORMPROPERTIES.ENUMVALUES.EMPTY
                    </div>
                  </div>
                </div>
              </div>
              <div class="form-group">
                <label for="expressionField">{{ 'PROPERTY.FORMPROPERTIES.EXPRESSION' | translate }}</label>
                <input
                  id="expressionField"
                  class="form-control"
                  type="text"
                  ng-model="selectedProperty.expression"
                  placeholder="{{ 'PROPERTY.FORMPROPERTIES.EXPRESSION.PLACEHOLDER' | translate }}"
                />
              </div>
              <div class="form-group">
                <label for="variableField">{{ 'PROPERTY.FORMPROPERTIES.VARIABLE' | translate }}</label>
                <input
                  id="variableField"
                  class="form-control"
                  type="text"
                  ng-model="selectedProperty.variable"
                  placeholder="{{ 'PROPERTY.FORMPROPERTIES.VARIABLE.PLACEHOLDER' | translate }}"
                />
              </div>
              <div class="form-group">
                <label for="defaultField">{{ 'PROPERTY.FORMPROPERTIES.DEFAULT' | translate }}</label>
                <input
                  id="defaultField"
                  class="form-control"
                  type="text"
                  ng-model="selectedProperty.default"
                  placeholder="{{ 'PROPERTY.FORMPROPERTIES.DEFAULT.PLACEHOLDER' | translate }}"
                />
              </div>
              <div class="form-inline">
                <div class="form-group col-xs-2">
                  <label for="requiredField">{{ 'PROPERTY.FORMPROPERTIES.REQUIRED' | translate }}</label>
                  <input id="requiredField" class="checkbox" type="checkbox" ng-model="selectedProperty.required" />
                </div>
                <div class="form-group col-xs-2">
                  <label for="readableField">{{ 'PROPERTY.FORMPROPERTIES.READABLE' | translate }}</label>
                  <input id="readableField" class="checkbox" type="checkbox" ng-model="selectedProperty.readable" />
                </div>
                <div class="form-group col-xs-2">
                  <label for="writableField">{{ 'PROPERTY.FORMPROPERTIES.WRITABLE' | translate }}</label>
                  <input id="writableField" class="checkbox" type="checkbox" ng-model="selectedProperty.writable" />
                </div>
              </div>
            </div>
            <div ng-show="!selectedProperty" class="muted no-property-selected" translate>
              PROPERTY.FORMPROPERTIES.EMPTY
            </div>
          </div>
        </div> -->

        <ul class="table-title eight-col">
          <li style="text-indent: 38px;">{{ 'PROPERTY.FORMPROPERTIES.ID' | translate }}</li>
          <li>{{ 'PROPERTY.FORMPROPERTIES.NAME' | translate }}</li>
          <li>{{ 'PROPERTY.FORMPROPERTIES.TYPE' | translate }}</li>
          <li>{{ 'PROPERTY.FORMPROPERTIES.DATEPATTERN' | translate }}</li>
          <li>{{ 'PROPERTY.FORMPROPERTIES.EXPRESSION' | translate }}</li>
          <li>{{ 'PROPERTY.FORMPROPERTIES.VARIABLE' | translate }}</li>
          <li>{{ 'PROPERTY.FORMPROPERTIES.DEFAULT' | translate }}</li>
          <li>属性</li>
          <li style="text-align: center;">操作</li>
        </ul>
        <ul class="value-table value-eight-col">
          <li ng-repeat="selectedProperty in formProperties" id="$index">
              <div>
                  <span>
                    <i class="iconfont icon-edit"></i>
                  </span>
                  <input
                    class="form-control"
                    type="text"
                    style="width:80%;"
                    ng-model="selectedProperty.id"
                    ng-focus="setSelectedProperty(selectedProperty)"
                    placeholder="{{ 'PROPERTY.FORMPROPERTIES.ID.PLACEHOLDER' | translate }}"
                  />
                </div>
                <div>
                  <input
                    type="text"
                    class="form-control"
                    ng-model="selectedProperty.name"
                    ng-focus="setSelectedProperty(selectedProperty)"
                    placeholder="{{ 'PROPERTY.FORMPROPERTIES.NAME.PLACEHOLDER' | translate }}"
                  />
                </div>
                <div>
                  <select
                    class="form-control"
                    ng-model="selectedProperty.type"
                    ng-change="propertyTypeChanged(selectedProperty)"
                  >
                    <option>string</option>
                    <option>long</option>
                    <option>boolean</option>
                    <option>date</option>
                    <option>enum</option>
                  </select>
                </div>
                <div>
                  <input
                    type="text"
                    class="form-control"
                    ng-show="!selectedProperty.datePattern"
                    ng-model="selectedProperty.datePattern"
                    disabled
                    placeholder="{{ 'PROPERTY.FORMPROPERTIES.DATEPATTERN.PLACEHOLDER' | translate }}"
                  />
                  <input
                    type="text"
                    class="form-control"
                    ng-model="selectedProperty.datePattern"
                    ng-show="selectedProperty.datePattern"
                    ng-focus="setSelectedProperty(selectedProperty)"
                    placeholder="{{ 'PROPERTY.FORMPROPERTIES.DATEPATTERN.PLACEHOLDER' | translate }}"
                  />
                </div>
                <div>
                  <input
                    class="form-control"
                    type="text"
                    ng-model="selectedProperty.expression"
                    ng-focus="setSelectedProperty(selectedProperty)"
                    placeholder="{{ 'PROPERTY.FORMPROPERTIES.EXPRESSION.PLACEHOLDER' | translate }}"
                  />
                </div>
                <div>
                  <input
                    class="form-control"
                    type="text"
                    ng-model="selectedProperty.variable"
                    ng-focus="setSelectedProperty(selectedProperty)"
                    placeholder="{{ 'PROPERTY.FORMPROPERTIES.VARIABLE.PLACEHOLDER' | translate }}"
                  />
                </div>
                <div>
                  <input
                    class="form-control"
                    type="text"
                    ng-model="selectedProperty.default"
                    ng-focus="setSelectedProperty(selectedProperty)"
                    placeholder="{{ 'PROPERTY.FORMPROPERTIES.DEFAULT.PLACEHOLDER' | translate }}"
                  />
                </div>
                <div>
                  <label for="requiredField">{{ 'PROPERTY.FORMPROPERTIES.REQUIRED' | translate }}</label>
                  <input class="checkbox" type="checkbox" ng-model="selectedProperty.required" />
                  <label for="readableField">{{ 'PROPERTY.FORMPROPERTIES.READABLE' | translate }}</label>
                  <input class="checkbox" type="checkbox" ng-model="selectedProperty.readable" />
                  <label for="writableField">{{ 'PROPERTY.FORMPROPERTIES.WRITABLE' | translate }}</label>
                  <input class="checkbox" type="checkbox" ng-model="selectedProperty.writable" />
                </div>
                <div>
                  <span title="{{ 'ACTION.REMOVE' | translate }}"
                    ng-click="removeProperty(selectedProperty)">
                    <i class="iconfont icon-reduce_1"></i>
                  </span>
                  <span ng-if="$index == formProperties.length-1" title="{{ 'ACTION.ADD' | translate }}"
                    ng-click="addNewProperty()">
                    <i class="iconfont icon-add_1"></i>
                  </span>
                </div>
          </li>
        </ul>
        <div ng-click="addNewProperty()" style="width: 200%;" ng-if="!formProperties.length" class="add-data-property">没有配置动态表单属性，点击此处添加</div>
        
      </div>
      <ul class="table-title three-col" ng-show="selectedProperty.enumValues" style="margin-top: 30px;">
          <li style="text-indent: 38px;">{{ 'PROPERTY.FORMPROPERTIES.VALUES.ID' | translate }}</li>
          <li>{{ 'PROPERTY.FORMPROPERTIES.VALUES.NAME' | translate }}</li>
          <li style="text-align: center;">操作</li>
      </ul>
      <ul class="value-table value-three-col" ng-show="selectedProperty.enumValues && selectedProperty.enumValues.length">
        <li ng-repeat="selectedEnumValue in selectedProperty.enumValues" id="$index">
            <div>
              <span>
                <i class="iconfont icon-edit"></i>
              </span>
              <input type="text" class="form-control del-border" style="width:80%;" ng-model="selectedEnumValue.id" />
            </div>
            <div>
              <input type="text" class="form-control del-border" ng-model="selectedEnumValue.name" />
            </div>
            <div>
              <span title="{{ 'ACTION.REMOVE' | translate }}"
                ng-click="removeEnumValue(selectedEnumValue)">
                <i class="iconfont icon-reduce_1"></i>
              </span>
              <span ng-if="$index == selectedProperty.enumValues.length-1" title="{{ 'ACTION.ADD' | translate }}"
                ng-click="addNewEnumValue()">
                <i class="iconfont icon-add_1"></i>
              </span>
            </div>
        </li>
      </ul>
      <div ng-click="addNewEnumValue()" ng-if="selectedProperty.enumValues && !selectedProperty.enumValues.length" class="add-data-property">点击此处添加enum</div>
    
      <div class="modal-footer">
          <button ng-click="save()" class="btn save-btn" translate>ACTION.SAVE</button>
          <button ng-click="cancel()" class="btn close-btn" translate>GENERAL.ACTION.CLOSE</button>
      </div>
    </div>
  </div>
</div>
